<?php
/**
 * Created by PhpStorm.
 * User: fangwei
 * Date: 2019-07-14
 * Time: 16:38
 */

namespace App\Http\Controllers\Admin\Api;


use App\Http\Controllers\Controller;
use App\Http\Repositories\Services\IRegion;
use App\Util\ResultsVo;
use Illuminate\Support\Facades\Lang;

class RegionController extends Controller
{
    protected $regionService;

    public function __construct(IRegion $regionService)
    {
        $this->regionService = $regionService;
    }

    public function lists($parent_id){
        $search = [];
        $search['parent_id'] = $parent_id;
        $data = $this->regionService->lists($search);
        return response()->json(new ResultsVo(['data'=>$data,'message'=>Lang::get('response.success')]));
    }
}